﻿<phone:PhoneApplicationPage
        
    x:Class="Techdays2013.TextToSpeechPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d"
    
    xmlns:behaviors="clr-namespace:SamuelBlanchard.Accessibility" 
    
    behaviors:SpeechBehavior.CanSpeak="True"
    behaviors:SpeechBehavior.Language="fr-FR"
    
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    toolkit:TiltEffect.IsTiltEnabled="True"
    shell:SystemTray.IsVisible="True"  
    >

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
                                
        <ScrollViewer ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.VerticalScrollBarVisibility="Auto">
            <StackPanel Margin="6">

                <Border Height="173" VerticalAlignment="Top"  Background="DarkViolet" Margin="6">
                    <StackPanel Margin="12" VerticalAlignment="Center">
                        <TextBlock Text="TextToSpeech" FontSize="50" FontFamily="Segoe WP light" HorizontalAlignment="Center" Margin="12,0"/>
                    </StackPanel>
                </Border>

                <StackPanel Margin="6,6,6,0">

                    <!-- Parle moi -->
                    
                        <toolkit:ExpanderView Margin="0,0,0,6" IsExpanded="True">
                            <toolkit:ExpanderView.Header>
                                <Grid Background="Magenta" Width="458">

                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                                    <ColumnDefinition Width="*"></ColumnDefinition>
                                </Grid.ColumnDefinitions>

                                    <Image Grid.Column="0" VerticalAlignment="Center"  Source="/Assets/Icons/Speech.png" Height="48"></Image>
                                    <TextBlock Grid.Column="1" VerticalAlignment="Center" Foreground="White" Text="Hello world"></TextBlock>
                                </Grid>
                                
                            </toolkit:ExpanderView.Header>

                        <toolkit:ExpanderView.Items>
                            
                            <toolkit:PhoneTextBox x:Name="TextBoxMaPhrase" Hint="Ma phrase" Text="Hello world !" ActionIcon="Assets/icons/Refresh.png" ActionIconTapped="TextBoxMaPhrase_ActionIconTapped_1" />
                            
                            <Button Style="{StaticResource ButtonMetro}" HorizontalAlignment="Center" Margin="12" Background="Green" Content="Parle-moi !" Click="Button_Click_Talk"></Button>
                            
                        </toolkit:ExpanderView.Items>

                    </toolkit:ExpanderView>

                    <!-- Langue + Gender -->

                    <toolkit:ExpanderView Margin="0,0,0,6">
                        <toolkit:ExpanderView.Header>
                            <Grid Background="DodgerBlue" Width="458">

                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                                    <ColumnDefinition Width="*"></ColumnDefinition>
                                </Grid.ColumnDefinitions>

                                <Image Grid.Column="0" VerticalAlignment="Center"  Source="/Assets/Icons/Speech.png" Height="48"></Image>
                                <TextBlock Grid.Column="1" VerticalAlignment="Center" Foreground="White" Text="Bonjour Madame"></TextBlock>
                            </Grid>

                        </toolkit:ExpanderView.Header>

                        <toolkit:ExpanderView.Items>

                            <toolkit:ListPicker x:Name="ListPickerLanguage" ItemsSource="{Binding VoiceLanguages}">
                                <toolkit:ListPicker.FullModeItemTemplate>
                                    <DataTemplate>
                                        <TextBlock Text="{Binding DisplayName}" FontSize="30"></TextBlock>
                                    </DataTemplate>
                                </toolkit:ListPicker.FullModeItemTemplate>
                            </toolkit:ListPicker>

                            <toolkit:ToggleSwitch x:Name="ToggleGender" Header="Voix de la Madame" IsChecked="True"></toolkit:ToggleSwitch>

                            <Button Style="{StaticResource ButtonMetro}" HorizontalAlignment="Center" Margin="0,0,0,12" Background="Green" Content="Susurre-moi !" Click="Button_Click_LanguageGender"></Button>

                        </toolkit:ExpanderView.Items>

                    </toolkit:ExpanderView>

                    <!-- Les experts -->

                    <toolkit:ExpanderView Margin="0,0,0,6">
                        <toolkit:ExpanderView.Header>
                            <Grid Background="DarkViolet" Width="458">

                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                                    <ColumnDefinition Width="*"></ColumnDefinition>
                                </Grid.ColumnDefinitions>

                                <Image Grid.Column="0" VerticalAlignment="Center"  Source="/Assets/Icons/Speech.png" Height="48"></Image>
                                <TextBlock Grid.Column="1" VerticalAlignment="Center" Foreground="White" Text="Les experts"></TextBlock>
                            </Grid>

                        </toolkit:ExpanderView.Header>

                        <toolkit:ExpanderView.Items>

                            <toolkit:ListPicker x:Name="ListPickerSsml" ItemsSource="{Binding SsmlSamples}">
                            </toolkit:ListPicker>

                            <toolkit:PhoneTextBox x:Name="TextBoxSsml" Text="{Binding SelectedItem.Tag, ElementName=ListPickerSsml}" TextWrapping="Wrap"></toolkit:PhoneTextBox>

                            <Button Margin="0,12,0,12" Style="{StaticResource ButtonMetro}" HorizontalAlignment="Center" Background="Green" Content="You talk to me ?" Click="Button_Click_SSML"></Button>

                        </toolkit:ExpanderView.Items>

                    </toolkit:ExpanderView>

                    <!-- Exemple -->
                    
                    <toolkit:ExpanderView Margin="0,0,0,6">
                        <toolkit:ExpanderView.Header>
                            <Grid Background="DarkRed" Width="458">

                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                                    <ColumnDefinition Width="*"></ColumnDefinition>
                                </Grid.ColumnDefinitions>

                                <Image Grid.Column="0" VerticalAlignment="Center"  Source="/Assets/Icons/Speech.png" Height="48"></Image>
                                <TextBlock Grid.Column="1" VerticalAlignment="Center" Foreground="White" Text="Exemple"></TextBlock>
                            </Grid>

                        </toolkit:ExpanderView.Header>

                        <toolkit:ExpanderView.Items>

                            <TextBlock Margin="0,12,0,12" Text="L'accessibilité des textes au mal voyant peut être une application intéressante du TextToSpeech. Appuyer sur un TextBlock jusqu'a ce qu'il devienne transparent puis relacher pour entendre le texte qu'il contient." TextWrapping="Wrap"></TextBlock>
                            
                        </toolkit:ExpanderView.Items>

                    </toolkit:ExpanderView>

                </StackPanel>

            </StackPanel>

        </ScrollViewer>

        <Grid x:Name="GridFade" Background="Black" Visibility="Collapsed">
        </Grid>

    </Grid>

</phone:PhoneApplicationPage>